<script>
import { ref } from 'vue'

export default {
  setup() {
    console.log('setup函数执行了', this)

    const msg = ref('你好呀')
    const changeMsg = () => {
      msg.value = '我很好'
    }

    return { msg, changeMsg }
  },
  beforeCreate() {
    console.log('beforeCreate函数执行了', this)
  }
}
</script>

<template>
  <div>
    <h3>{{ msg }}</h3>
    <button @click="changeMsg">改一改</button>
  </div>
</template>

<style scoped></style>
